package com.superitem.school.handler;


import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.servlet.ModelAndView;

@ControllerAdvice
public class MyErrorHander {
//
//    @ExceptionHandler(RuntimeException.class)
//    @ResponseStatus
//    public ModelAndView processException(RuntimeException re){
//        ModelAndView mv = new ModelAndView();
//        mv.addObject("myException", re.getMessage());
//        mv.setViewName("error/500");
//        return mv;
//    }
//
//    @ExceptionHandler(Exception.class)
//    @ResponseStatus
//    public String processException(Exception e, Model model){
//        model.addAttribute("myException", e.getMessage());
//        return "error/500";
//    }
}
